package rmi;

import java.rmi.Remote;
import java.rmi.RemoteException;
import java.util.ArrayList;

import po.UserIdentity;

import vo.BookVO;
import vo.CatalogVO;
import vo.CustomerBasicInfoVO;
import vo.OrderVO;
import vo.SaleItemVO;
import vo.SearchKeyVO;
import vo.BLToViewResultMessage;

import exception.BookInventoryNotFoundException;
import exception.FavorMaxException;
import exception.FavorRepeatException;
import exception.ItemNotEnoughException;
import exception.ItemNotFoundException;
import exception.MemberNotFoundException;
import exception.MemberNotMatchException;
import exception.NotFavorException;
import exception.OrderCancelNotPermittedException;
import exception.OrderNotExistException;
import exception.UserDeletedException;
import exception.UserNotExistException;
import exception.UserNotFoundException;
import exception.WrongPasswordException;

public interface CustomerServiceRemote extends Remote {

	public BLToViewResultMessage requireRegister(String username,
			String password) throws RemoteException;

	public BLToViewResultMessage checkUsername(String username)
			throws RemoteException;

	public BLToViewResultMessage changePassword(int userID, String newPassword)
			throws UserNotFoundException, RemoteException;

	public CustomerBasicInfoVO requireMemberInfo(int memberID)
			throws MemberNotFoundException, RemoteException;

	public int requireLogin(String username, String password,
			UserIdentity userIdentity) throws WrongPasswordException,
			UserDeletedException, UserNotExistException, RemoteException;

	public ArrayList<BookVO> search(int catalogID) throws RemoteException;

	public ArrayList<BookVO> directSearch(String key) throws RemoteException;

	public ArrayList<BookVO> advanceSearch(SearchKeyVO key)
			throws RemoteException;

	public ArrayList<CatalogVO> getList() throws RemoteException;

	public String getName(int catalogID) throws RemoteException;

	public int getCatalogID(String name) throws RemoteException;

	public ArrayList<BookVO> viewMyFavor(int memberID)
			throws MemberNotFoundException, RemoteException;

	public BLToViewResultMessage requireFavor(int memberID, int bookID)
			throws MemberNotFoundException, FavorMaxException,
			FavorRepeatException, RemoteException;

	public BLToViewResultMessage cancelFavor(int memberID, int bookID)
			throws MemberNotFoundException, NotFavorException, RemoteException;

	public OrderVO startApplication(int memberID)
			throws MemberNotFoundException, RemoteException;

	public BLToViewResultMessage submitOrder(int memberID, OrderVO order)
			throws MemberNotMatchException, MemberNotFoundException,
			RemoteException;

	public ArrayList<OrderVO> viewMyOrder(int memberID)
			throws MemberNotFoundException, RemoteException;

	public BLToViewResultMessage cancelOrder(int memberID, int orderID)
			throws MemberNotFoundException, OrderNotExistException,
			OrderCancelNotPermittedException, RemoteException;

	public BLToViewResultMessage deleteOrder(int memberID, int orderID)
			throws MemberNotFoundException, OrderNotExistException,
			RemoteException;

	public ArrayList<SaleItemVO> getTrolley(int memberID)
			throws MemberNotFoundException, RemoteException;

	public BLToViewResultMessage addItem(int memberID, SaleItemVO saleItem)
			throws MemberNotFoundException, ItemNotEnoughException,
			ItemNotFoundException, BookInventoryNotFoundException,
			RemoteException;

	public BLToViewResultMessage deleteItem(int memberID, int bookID)
			throws MemberNotFoundException, ItemNotFoundException,
			RemoteException;

	public BLToViewResultMessage modifyQuantity(int memberID, int bookID,
			SaleItemVO saleItem) throws MemberNotFoundException,
			ItemNotFoundException, BookInventoryNotFoundException,
			ItemNotEnoughException, RemoteException;

	public double getTotalPrice(int memberID) throws MemberNotFoundException,
			RemoteException;
}
